package com.wkhyapp.lm.contract;

import com.wkhyapp.lm.base.BasePresenter;
import com.wkhyapp.lm.http.ApiCallback;
import com.wkhyapp.lm.http.net.SuperResponse;
import com.wkhyapp.lm.http.net.UserListRequest;
import com.wkhyapp.lm.http.vo.ThinkUser;

/**
 * Created by fang on 2021/11/24.
 */

public class KTSJPresenter extends BasePresenter<SYSJView> {


    public KTSJPresenter(SYSJView sysjView) {
        super(sysjView);
    }

    public void getData(int pageNo){
        UserListRequest request = new UserListRequest();
        request.setPageNo(pageNo);
        request.setPageSize(15);
        addSubscription(apiStores.kthy(request),new ApiCallback<SuperResponse<ThinkUser>>() {
            @Override
            public void onSuccess(SuperResponse<ThinkUser> response) {
                mvpView.setMemberList(response.getItems(),response.getTotals());
            }
            @Override
            public void onFailure(String msg) {

            }

            @Override
            public void onFinish() {
                mvpView.dismissLoad();
            }
        });

    }

    public void getDataMore(int pageNo){
        UserListRequest request = new UserListRequest();
        request.setPageNo(pageNo);
        request.setPageSize(15);
        addSubscription(apiStores.kthy(request),new ApiCallback<SuperResponse<ThinkUser>>() {
            @Override
            public void onSuccess(SuperResponse<ThinkUser> response) {
                mvpView.setMemberMoreList(response.getItems());
            }
            @Override
            public void onFailure(String msg) {

            }

            @Override
            public void onFinish() {
                mvpView.dismissLoad();
            }
        });

    }
}
